Displaying Captured Images using a Form View

Description

It is easy to configure a Form View such that it can be used to select and save, or 'capture', images to a list control.

An image captured in a form view (right) and saved into a list control (red arrow)
An image captured in a form view (right) and saved into a list control (red arrow)

In this example, a form view opens after a user clicks on a given row in the list control. The user can then select an image from his or her file system to display in the form view and, if desired, add to the list control. For a visual explanation watch this video or read the guide below.

  1. In the UX Builder, open the Controls page. In the Data Controls menu click [List] to add a list control to the component.

    Im
  2. In the control's properties list, in the List Properties section, click on the 'List properties' property to open the List Builder.

    Im2
  3. In the List Builder's Data Source pane select 'Static' in the Data Source Type' menu.

    Im3
  4. Click the [...] button next to the Static data property.

    Im4
  5. In the Static Choices dialog click the 'Sample data' button in the lower left corner.

    Im5
  6. Add the 'Name and addresses' data and click OK.

    Im6
  7. In the first row of the data add a fifth field named 'Picture'. Your Static Choices data should look like this, click OK:

    Im7
  8. Open the 'Fields' pane of the List Builder. On the left, highlight the 'Picture' field.

    Im8
  9. In the Client-side section of the 'Picture' field's properties list, on the right, click the [...] button next to the 'Control type' property. Set the control type to be 'Image'

    Im9
  10. In the Image Properties section set the 'Image Data type' to be Base64.

    Im10
  11. Open the 'List Layout' pane. Use the blue > arrow to move all of the data fields from the Available fields list into the Columns in List. Then click OK to close the list builder.

    Im11
  12. On the UX coontrols page open the Other Controls menu. Click on the [Form View] option to add a form view control to the component.

    Im12
  13. Click on Form properties to open the form view builder.

    Im13
  14. Open the Data Source pane. Set the Datasource type to 'List'. Using the dropdown, set the List name property to be list1, or the name of the list defined earlier.

    Im14
  15. Open the Fields pane and highlight the 'Picture' field.

    Imfix1
  16. In the Field Properties section change the Field type from 'Unspecified' to 'Image'.

    Imfix2
  17. In the Image Field Properties for the 'Picture' field check the 'Allow image capture' checkbox.

    Imfix3
  18. Open the Form Layout pane of the Form View Builder and Click the 'Add item' button.

    Im15
  19. In 'Category' menu select Data Controls, in the Control menu select [Label], and in the field list select highlight the Firstname, Lastname, City, and State fields. Click OK to add theses to the control.

    Im16
  20. Click the 'Add item' button again. Select 'Data Controls' again in the Category menu. This time in the Control menu select [Image-Databound], then highlight the 'Picture' field and click OK.

    Im17
  21. Click the 'Add item' button in the Form Layout pane one final time.

    Im19
  22. In the Category menu select 'Pre-defined Controls'. In the Control menu select [Save Form Edits/Cancel Edits Button] and click OK.

    Im18
  23. Highlight the [Image-DataBound: Picture] item that you added. In the Image Properties section of its properties list click on the [...] button next to the 'Missing image HTML' property.

    Im20
  24. Add the following message. This will be displayed when there is no defined image.

    Click here to capture an image.
    Im21
  25. In the Camera/Image Capture section check the Allow image capture property. Set the Image capture method to be 'TapOnImage'. Click OK to close the Form View Builder.

    Im22
  26. On the UX Controls page again open the Containers menu. Click on the [Container] option. On the Insert Container dialog's 'Container Type' menu, select 'Editor Set' and hit the 'Insert After' button.

    Im23
  27. Open the Defined Controls menu. Click on the Editor-Textbox option to add an editor inside the editor set container.

    Im24
  28. Highlight the Form View control. Open the Form View Builder again and go to the Fields pane.

    Im25
  29. In the 'Editing' section click the [...] button next to the 'Editor set' property.

    Im26
  30. In the Select Editor dialog highlight the Editor set you defined and then the Editor. Click the 'Assign selection to multiple fields' button, highlight all of the fields and click OK.

    Im27
  31. Close the Form View Builder and run the component in Live Preview. Highlight a row in the list to open th form view. The click on the picture field to edit it. Navigate to the picture you want to insert on selected list row.

    Im28
  32. Click the Save Button to save the image to the list.

    Im29
  33. Im30

See Also